const path=require("path"),fs=require("fs"),{Files,config,rpath}=require(path.join(__dirname,"/config.bundle"));let $=require(path.join(__dirname,"/config.bundle"));module.exports=function(){document.querySelector(".gload__from-pop").style.display="none",document.querySelector(".gload__from-container").style.display="none",document.querySelector(".path__from-pop").style.display="flex",document.querySelector(".path__from-container").style.display="block",document.querySelector(".bth__path-save").addEventListener("click",async function(){const a=document.querySelector("#path-from"),b=document.querySelector("#path-to");if(""!==a.value.replace(/\s/g,"")||""!==b.value.replace(/\s/g,"")){const c=new Map([["start",{name:"\u0411\u0430\u0437\u043E\u0432\u044B\u0439",pathFrom:a.value.trim(),pathTo:b.value.trim(),typeFiles:"",sizeFiles:"",wordLeft:"",wordRight:"",changed:"",remember:[],regexp:[]}]]);$.db.length=0,$.db.push(Object.fromEntries(c)),fs.writeFileSync(path.join(__dirname,rpath.db),JSON.stringify($.db)),document.querySelector(".path__from-pop").style.display="none",document.querySelector(".path__from-container").style.display="none",a.value="",b.value="",$._fs=new Files($.db,".file__tbody"),1===config.ReadSubfolders?(document.querySelector("#global__change").setAttribute("checked","true"),document.querySelector("#global__change").checked=!0,$._fs.setReadSubfolders(1)):(document.querySelector("#global__change").removeAttribute("checked"),document.querySelector("#global__change").checked=!1,$._fs.setReadSubfolders(0)),document.querySelector(".loader").style.display="none",$._fs.startPreset("start"),await $._fs.loadFiles(),$._fs.setTheme($.config.theme),$._fs.setLang($.config.lang)}})};
